package com.qhs.framework.utils;

import com.qhs.sms.SmsSingleSender;
import com.qhs.sms.SmsSingleSenderResult;

import java.util.ArrayList;

/**
 * Created by zano on 2017/4/7.
 */
public class QsmsUtil {
    private int appid = Integer.parseInt(ConfigUtil.get("appid"));
    private String appkey = ConfigUtil.get("appkey");
    private String sign = "全换机";
    public SmsSingleSenderResult sendSms(String phone, ArrayList<String> params, Integer tempId){
        try {
            SmsSingleSender singleSender = new SmsSingleSender(appid, appkey);

            return singleSender.sendWithParam("86", phone, tempId, params, sign, "", "");
        }catch (Exception e){
            e.printStackTrace();
            return new SmsSingleSenderResult();
        }
    }
    public SmsSingleSenderResult sendSingle(String phone,String msg){
        try{
            SmsSingleSender singleSender = new SmsSingleSender(appid, appkey);
            return   singleSender.send(0,"86",phone,msg,"","");
        }catch (Exception e){
            e.printStackTrace();
        }
        return new SmsSingleSenderResult();
    }
}
